#pragma once

#include <linux/string.h>

static inline unsigned long raw_copy_from_user(void *to, const void *from, unsigned long n)
{
    memcpy(to, (const void *)from, n);

    return 0;
}

static inline unsigned long raw_copy_to_user(void *to, const void *from, unsigned long n)
{
    memcpy((void *)to, from, n);

    return 0;
}

/*
 * These are the main single-value transfer routines.  They automatically
 * use the right size if we just have the right pointer type.
 * This version just falls back to copy_{from,to}_user, which should
 * provide a fast-path for small values.
 */
#define __put_user(x, ptr)            \
    ({                                \
        __typeof__(*(ptr)) __x = (x); \
        int __pu_err = -EFAULT;       \
        pr_todo();                    \
        __pu_err;                     \
    })
